package com.ramos.kuaixiao.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;

import com.githang.statusbar.StatusBarCompat;
import com.ramos.kuaixiao.R;

public class AddAdviceActivity extends BaseActivity implements TextWatcher, View.OnClickListener {


    private Button btn_edit_suggest;
    private EditText et_suggest;
    private ImageView reback_suggest;
    private String suggestion;
    private String userid;
    private Intent intent;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_advice_add);
        StatusBarCompat.setStatusBarColor(this, getResources().getColor(R.color.title), false);
        intent = getIntent();
        userid = intent.getStringExtra("userid");
        //adviceServiceClient = AdviceServiceClient.singleInstance(this);
        reback_suggest = (ImageView) findViewById(R.id.reback_suggest_add);
        et_suggest = (EditText) findViewById(R.id.et_suggest_add);
        btn_edit_suggest = (Button) findViewById(R.id.btn_edit_suggest_add);
        reback_suggest.setOnClickListener(this);
        et_suggest.addTextChangedListener(this);
        btn_edit_suggest.setOnClickListener(this);
    }


    @Override
    public void onClick(View v) {
        int id = v.getId();
        if (id == R.id.reback_suggest_add) {
            AddAdviceActivity.this.finish();
        }
        else if (id == R.id.btn_edit_suggest_add) {
            //提交意见
            //uploadAdvice();
        }
    }

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {

    }

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {

    }

    @Override
    public void afterTextChanged(Editable s) {
        suggestion = s.toString();
    }
}
